#!/bin/bash

#Boot
#
#Authors:
#  Bruno Goncalves Araujo <www.biglinux.com.br>
#
#License: GPLv2 or later
#################################################

CMDLINE="$(cat /proc/cmdline)"

stringinstring(){
case "$2" in *$1*) return 0;; esac
return 1
}

getbootparam(){
stringinstring " $1=" "$CMDLINE" || return 1
result="${CMDLINE##*$1=}"
result="${result%%[ 	]*}"
echo "$result"
return 0
}

echo "0" > /proc/sys/dev/cdrom/lock

        if [ "$(grep "xhost +" /etc/X11/Xsession)" = "" ]
        then
            sed -i '/^# sanity check/{h;s/.*/xhost + SI:localuser:root/;p;x}' /etc/X11/Xsession
        fi

ln -sf /usr/src/linux-headers-$(uname -r) /usr/src/linux
#bigxorgedit --config screen= $(getbootparam 'screen') xmodule=$(getbootparam 'xmodule') refresh=$(getbootparam 'refresh') edid=$(getbootparam 'edid') mouse=$(getbootparam 'mouse')